package com.cvit.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cvit.model.Msg;
import com.cvit.model.Science;
import com.cvit.service.ScienceService;

@Controller
public class ScienceController {
	@Autowired
	ScienceService scienceService;

	@ResponseBody
	@RequestMapping("/getArts")
	public Msg getArts(@RequestParam("section_type") int section_type,@RequestParam("overall_type") String overall_type,@RequestParam("ids") List ids) {
		List<Science> science=null;
		 if(section_type==1) {
			science = scienceService.getArts(overall_type,ids);
		} else if(section_type==2){
			science = scienceService.getScience(overall_type,ids);	
		}else {
			science=scienceService.getAll();
		}
		return Msg.success().add("science", science);
	}
	
}
